GTK_FLAGS = `pkg-config --cflags gtk+-3.0`
GTK_LIBS = `pkg-config --libs gtk+-3.0`
OBJECTS = $(patsubst src/%.c, build/%.o, $(wildcard src/*.c))

run: build
	./crypt data/example.csv

clean:
	rm build/*.o crypt

build: $(OBJECTS)
	gcc $(GTK_LIBS) build/*.o -o crypt

build/main.o: src/main.c
	gcc -c $(GTK_FLAGS) src/main.c -o build/main.o

build/builder.o: src/builder.c src/builder.h
	gcc -c $(GTK_FLAGS) src/builder.c -o build/builder.o

build/logic.o: src/logic.c src/logic.h
	gcc -c $(GTK_FLAGS) src/logic.c -o build/logic.o

build/generate_from_file.o: src/generate_from_file.c src/generate_from_file.h
	gcc -c $(GTK_FLAGS) src/generate_from_file.c -o build/generate_from_file.o

build/generate_single.o: src/generate_single.c src/generate_single.h
	gcc -c $(GTK_FLAGS) src/generate_single.c -o build/generate_single.o

build/password_generator.o: src/password_generator.c src/password_generator.h
	gcc -c src/password_generator.c -o build/password_generator.o

